package main

/**
 *@Author: yepeng
 *@Date: 2022/4/27 05:44
 *@Name: main
 *@Desc:
 */
import (
	"github.com/gin-gonic/gin"
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
	"log"
)

var db *gorm.DB

func main() {
	dsn := "root:0112358@tcp(121.43.39.35:3306)/uniswapv3?charset=utf8mb4&parseTime=True&loc=Local"
	idb, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})

	if err != nil {
		log.Fatalf(" db error %s", err.Error())
	}
	db = idb
	router := gin.Default()
	router.GET("/kline", KLine)
	err = router.Run()
	if err != nil {
		return
	}
}
